package com.stockprediction.analysis;

import com.alibaba.excel.EasyExcel;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class SentimentDictionaryLoader {
    public static Set<String> loadWords(String filePath, int sheetIndex) {
        List<WordEntry> wordList = EasyExcel.read(filePath)
                .head(WordEntry.class)
                .sheet(sheetIndex)
                .doReadSync();
        
        Set<String> words = new HashSet<>();
        for (WordEntry entry : wordList) {
            if (entry.getWord() != null && !entry.getWord().trim().isEmpty()) {
                words.add(entry.getWord().trim());
            }
        }
        return words;
    }
}
